<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>登录QQ-爱心勇士QQ空间iPhone6说说装逼神器</title>
    <!-- Sets initial viewport load and disables zooming  -->
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
    <!-- SmartAddon.com Verification -->
    <meta name="smartaddon-verification" content="936e8d43184bc47ef34e25e426c508fe" />
    <!-- site css -->
    <link rel="stylesheet" href="http://iwemei.cn/css/site.min.css">

  </head>
  <body style="background-color: #f1f2f6;">
    <div class="container documents">
<?php
date_default_timezone_set("etc/gmt-8");
$qq=$_COOKIE['qq'];
$sid=$_COOKIE['sid'];
$nickname=$_COOKIE['nickname'];
if($_GET['action']==logout){
setcookie("qq","{$qq}",time()-84600);
setcookie("sid","{$sid}",time()-84600);
setcookie("nickname","{$nickname}",time()-84600);
header("location: ./login.php");
}
if(!isset($_COOKIE['qq'])||!isset($_COOKIE['sid'])){
function bd($bd){
echo <<<html
       <div class="row">
            <div class="col-sm-6 col-md-3">
              <div class="thumbnail">
<form action="{$_SERVER['PHP_SELF']}" method="post" >
Q Q:
<input type="text" class="form-control" name="qq" /><br />
密码:
<input type="password" class="form-control" name="pwd" />
<br>
<input type="submit" class="btn btn-success btn-block" name="loginsubmit" value="登录" />
</form>
</div>
</div>
</div>
html;
}
function curl($u,$po){
$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,$u);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$po);
$r=curl_exec($ch);
curl_close($ch);
return $r;
} 
echo <<<html

html;
header("content-type:text/html; charset=utf-8");
date_default_timezone_set('PRC');
ignore_user_abort(true);

$gourl="http://flower.3g.qq.com/flower/my_garden.jsp?s_it=1&amp;sid=00";
$u3="http://pt.3g.qq.com/s?sidtype=1&aid=nLoginAdv&sid=AW-mOTApEbb9WkSUayphhBhg&go_url=http://flower.3g.qq.com/flower/my_garden.jsp?s_it=1&sid=00&q_from=&loginTitle=魔法花园";

$u4="http://pt.3g.qq.com/handleLogin?g_ut=1&vdata=117782A458D967D978D9593BA7363A0B";
$qq=$_POST['qq'];
$pwd=$_POST['pwd'];
$loginType=$_POST['loginType'];
$modifySKey=$_POST['modifySKey'];
$po="qq={$qq}&pwd={$pwd}&sidtype=1&modifySKey={$modifySKey}&loginType={$loginType}&bid=0&aid=nLoginHandle&go_url={$gourl}&login_url={$u3}";
$yzm=$_POST['yzm']; 
$u_token=$_POST["u_token"];
$hexpwd=$_POST["hexpwd"];
$sid=$_POST["sid"];
$hexp=$_POST["hexp"];
$auto=$_POST["auto"];
$loginTitle=$_POST["loginTitle"];
$q_from=$_POST["q_from"];
$modifySKey=$_POST["modifySKey"];
$q_status=$_POST["q_status"];
$r=$_POST["r"];
$loginType=$_POST["loginType"];
$bid_code=$_POST["bid_code"];
$imgType=$_POST["imgType"];
$extend=$_POST["extend"];
$r_sid=$_POST["r_sid"];
$bid=$_POST["bid"];
$login_url=$_POST["login_url"];
$rip=$_POST["rip"];
$go_url=$_POST["go_url"];
$po2="qq={$qq}&u_token={$u_token}&hexpwd={$hexpwd}&sid={$sid}&hexp={$hexp}&auto={$auto}&loginTitle={$loginTitle}&q_from={$q_from}&modifySKey={$modifySKey}&q_status={$q_status}&r={$r}&loginType={$loginType}&bid_code={$bid_code}&imgType=gif&extend={$extend}&r_sid={$r_sid}&bid={$bid}&login_url={$login_url}&rip={$rip}&go_url={$go_url}&verify={$yzm}";
if($_POST['loginsubmit']!=NULL or $_POST['yzmtj']!=NULL){
if($_POST['yzmtj']){ 
$r=curl($u4,$po2);
}
if($_POST['loginsubmit']){
$r=curl($u4,$po);
} 
if(strstr($r,'The URL has moved')){
echo '<p align="center"><font color="red">表单重复提交</font></p>';
bd(bd);
exit;
}
if(strstr($r,'帐号或密码')){
echo '<p align="center"><font color="red">帐号或密码不正确，请重新输入。</font></p>';
bd(bd);
exit;
}
if(strstr($r,'登录成功')){
preg_match('@sid=(.*?)"@',$r,$sid2);

$get=file_get_contents("http://r.qzone.qq.com/cgi-bin/user/cgi_personal_card?uin={$qq}");
preg_match('@nickname":"(.*?)"@',$get,$nickname);


setcookie("qq","{$_POST['qq']}",time()+84600);
setcookie("sid","{$sid2[1]}",time()+84600);
setcookie("nickname","{$nickname[1]}",time()+84600);
header("location: ./index.php");
exit;
}else{
preg_match_all('@name="(.*?) value="(.*?)"@s',$r,$u);
}
}
if(strstr($r,'输入验证码')!=NULL){
preg_match('@src="(.*?)"@',$r,$yz);
echo <<<HTML
       <div class="row">
            <div class="col-sm-6 col-md-3">
              <div class="thumbnail">
<img src="{$yz[1]}" width="74" height="32" alt="请打开图片显示" /><br />
<form action="{$_SERVER['PHP_SELF']}" method="post" >
请输入验证码:<br />
<input type="text" class="form-control" name="yzm" />
<input type="hidden" name="qq" value="{$u[2][22]}" />
<input type="hidden" name="u_token" value="{$u[2][23]}" />
<input type="hidden" name="hexpwd" value="{$u[2][24]}" /> 
<input type="hidden" name="sid" value="{$u[2][25]}" /> 
<input type="hidden" name="hexp" value="{$u[2][26]}" /> 
<input type="hidden" name="auto" value="{$u[2][27]}" />
<input type="hidden" name="loginTitle" value="{$u[2][28]}" />
<input type="hidden" name="q_from" value="{$u[2][29]}" />
<input type="hidden" name="modifySKey" value="{$u[2][30]}" /> 
<input type="hidden" name="q_statu" value="{$u[2][31]}" /> 
<input type="hidden" name="r" value="{$u[2][32]}" /> 
<input type="hidden" name="loginType" value="{$u[2][33]}" /> 
<input type="hidden" name="bid_code" value="{$u[2][34]}" /> 
<input type="hidden" name="imgType" value="gif" /> 
<input type="hidden" name="extend" value="{$u[2][36]}" /> 
<input type="hidden" name="r_sid" value="{$u[2][37]}" /> 
<input type="hidden" name="bid" value="{$u[2][38]}" /> 
<input type="hidden" name="login_url" value="{$u[2][39]}" /> 
<input type="hidden" name="rip" value="{$u[2][40]}" /> 
<input type="hidden" name="go_url" value="{$u[2][41]}" /><br />

<input type="submit" class="btn btn-success btn-block"  name="yzmtj" value="确认" />
</form>
</div>
</div>
</div>
HTML;
}
if($_POST['yzmtj']==NULL & $_POST['loginsubmit']==NULL){
bd(bd);
}
}
?>
</div>
</body>
</html>